package com.meiyue.bean.entity;

import javax.persistence.*;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_vehicles", schema = "test_yuedao", catalog = "")
public class TestVehiclesEntity {
    private int id;
    private String brand;
    private String model;
    private int vehicleLevelId;
    private String year;
    private int vehicleOwnerId;
    private String plateNo;
    private int numberPassengersAllowed;
    private int vehicleTrunkSizeId;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "brand", nullable = false, length = 100)
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Basic
    @Column(name = "model", nullable = false, length = 100)
    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    @Basic
    @Column(name = "vehicle_level_id", nullable = false)
    public int getVehicleLevelId() {
        return vehicleLevelId;
    }

    public void setVehicleLevelId(int vehicleLevelId) {
        this.vehicleLevelId = vehicleLevelId;
    }

    @Basic
    @Column(name = "year", nullable = false, length = 4)
    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    @Basic
    @Column(name = "vehicle_owner_id", nullable = false)
    public int getVehicleOwnerId() {
        return vehicleOwnerId;
    }

    public void setVehicleOwnerId(int vehicleOwnerId) {
        this.vehicleOwnerId = vehicleOwnerId;
    }

    @Basic
    @Column(name = "plate_no", nullable = false, length = 20)
    public String getPlateNo() {
        return plateNo;
    }

    public void setPlateNo(String plateNo) {
        this.plateNo = plateNo;
    }

    @Basic
    @Column(name = "number_passengers_allowed", nullable = false)
    public int getNumberPassengersAllowed() {
        return numberPassengersAllowed;
    }

    public void setNumberPassengersAllowed(int numberPassengersAllowed) {
        this.numberPassengersAllowed = numberPassengersAllowed;
    }

    @Basic
    @Column(name = "vehicle_trunk_size_id", nullable = false)
    public int getVehicleTrunkSizeId() {
        return vehicleTrunkSizeId;
    }

    public void setVehicleTrunkSizeId(int vehicleTrunkSizeId) {
        this.vehicleTrunkSizeId = vehicleTrunkSizeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestVehiclesEntity that = (TestVehiclesEntity) o;

        if (id != that.id) return false;
        if (vehicleLevelId != that.vehicleLevelId) return false;
        if (vehicleOwnerId != that.vehicleOwnerId) return false;
        if (numberPassengersAllowed != that.numberPassengersAllowed) return false;
        if (vehicleTrunkSizeId != that.vehicleTrunkSizeId) return false;
        if (brand != null ? !brand.equals(that.brand) : that.brand != null) return false;
        if (model != null ? !model.equals(that.model) : that.model != null) return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;
        if (plateNo != null ? !plateNo.equals(that.plateNo) : that.plateNo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (brand != null ? brand.hashCode() : 0);
        result = 31 * result + (model != null ? model.hashCode() : 0);
        result = 31 * result + vehicleLevelId;
        result = 31 * result + (year != null ? year.hashCode() : 0);
        result = 31 * result + vehicleOwnerId;
        result = 31 * result + (plateNo != null ? plateNo.hashCode() : 0);
        result = 31 * result + numberPassengersAllowed;
        result = 31 * result + vehicleTrunkSizeId;
        return result;
    }
}
